var api = "http://49.4.12.78:9003"
// var api = "http://192.168.1.158:8080"

function parameterFromUrl(parameter){
  function parameterFromTrueUrl(url){
    if(url.indexOf("?") > -1){
      let parametersStr = url.split("?")[1];
      let parametersArr = parametersStr.split("&");
      let parametersObj = {};
      parametersArr.forEach(ele => {
        let arr = ele.split("=")
        parametersObj[arr[0]] = arr[1]
      })
      return parametersObj[parameter]
    }else{
      return ''
    }
  }

  if(location.href.indexOf("#") > -1){
    let url = location.href.split("#")[0];
    return parameterFromTrueUrl(url)
  }else{
    return parameterFromTrueUrl(location.href)
  }
}
